<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec=http://www.thymeleaf.org/extras/spring-security>
<head>
    <meta charset="UTF-8">
    <title>登录页面</title>
</head>
<body>

<form action="/doLogin" method="post">
    <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">
    <label>用户名：</label>
    <input type="text" name="username">
    <lbel>密 码：</lbel>
    <input type="password" name="password">
    <button type="submit">Login</button>
    <input type="checkbox" name="remember-me">
    <span>记住我</span>
    <!-- ${session?.SPRING_SECURITY_LAST_EXCEPTION?.message} security自带的错误提示信息 -->
    <p th:if="${param.error}" th:text="${session?.SPRING_SECURITY_LAST_EXCEPTION?.message}" style="color: red"></p>
</form>

</body>
</html>